package com.springboot.ssm.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
public class PersonController {

    @Value("${person.lastName}")
    private String name;

    /*
        dateTime已经配置过日期格式化
     */
    @GetMapping("/sayHello")
    public String sayHello(@RequestParam("date") LocalDate dateTime){
        System.out.println(dateTime);
        return "Hello: " + this.name;
    }

}
